package pojo

import (
	"time"
)

type User struct {
	Id    uint   `gorm:"primaryKey;autoIncrement"`
	Email string `gorm:"unique;not null;size:32"`
	// `gorm:"-"` 忽略这个字段
	Token        string `gorm:"-"`
	Username     string `gorm:"unique"`
	Bio          string
	Image        string
	PasswordHash string `gorm:"not null;size:64"`
	CreatedAt    time.Time
	UpdatedAt    time.Time
}

// TableName 重命名表明
func (User) TableName() string {
	return "user"
}
